<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/bootstrap-theme.css" />
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/font-awesome.css" />
		<link rel="stylesheet" href="css/fangyuanguanli.css" />
		<link rel="stylesheet" href="css/housecontrol.css" />
		<link rel="bookmark" type="image/x-icon" href="img/favicon.ico" />
		<link rel="shortcut icon" href="img/favicon.ico">
		<link rel="icon" href="img/favicon.ico">
		<link rel="stylesheet" href="clock.css"/> 
	</head>
	<body>
		<!--导航栏-->
		<div class="a">
				<a href="index.jsp" target="_blank">
			<div>
				<svg viewBox="0 0 1000 1000" role="presentation" aria-hidden="true" focusable="false" class="jpg1">
                        <path d="m499.3 736.7c-51-64-81-120.1-91-168.1-10-39-6-70 11-93 18-27 45-40 
                            80-40s62 13 80 40c17 23 21 54 11 93-11 49-41 105-91 168.1zm362.2 43c-7 47-39 
                            86-83 105-85 37-169.1-22-241.1-102 119.1-149.1 141.1-265.1 90-340.2-30-43-73-64-128.1-64-111 
                            0-172.1 94-148.1 203.1 14 59 51 126.1 110 201.1-37 41-72 70-103 88-24 13-47 
                            21-69 23-101 15-180.1-83-144.1-184.1 5-13 15-37 32-74l1-2c55-120.1 122.1-256.1 199.1-407.2l2-5 
                            22-42c17-31 24-45 51-62 13-8 29-12 47-12 36 0 64 21 76 38 6 9 13 21 22 36l21 41 3 6c77 151.1 144.1
                            287.1 199.1 407.2l1 1 20 46 12 29c9.2 23.1 11.2 46.1 8.2 
                            70.1zm46-90.1c-7-22-19-48-34-79v-1c-71-151.1-137.1-287.1-200.1-409.2l-4-6c-45-92-77-147.1-170.1-147.1-92 
                            0-131.1 64-171.1 147.1l-3 6c-63 122.1-129.1 258.1-200.1 409.2v2l-21 46c-8 19-12 29-13 32-51 
                            140.1 54 263.1 181.1 263.1 1 0 5 0 10-1h14c66-8 134.1-50 203.1-125.1 69 75 137.1 117.1 203.1 
                            125.1h14c5 1 9 1 10 1 127.1.1 232.1-123 181.1-263.1z">
                        </path>
                    </svg>
			</div>
		</a>
			<div>
				<span class="a2" id="aaaaa"><canvas id="clock" width="50px" height="50px"></canvas></span>
			</div>
			
			
			<div>
			<a href="addhouse.html" taoget="_self">
				<button type="button" id="aaaa1"><i class="fa fa-plus-circle" aria-hidden="true"></i> 添加房源</button>
			</a>
			</div>
		</div>
		

		
		<!--房源数量-->
	
     <div id="fangyuanbiao"></div>
     
     
      <div class="modal fade" id="changehouse" role="dialog" aria-labelledby="houseinfoLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="houseinfoLabel">房源详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="container-fluid">
                                    	<!--第一行输入框（标题/名称）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4>房源名称/标题</h4>
										</div>
										<div class="col-md-10 col-md-offset-1">
											<input class="form-control"  id="housename"/>
										</div>
									</div>
									<!--第二行输入框（出租/房源类型）-->
									<div class="row">
										<div class="col-md-5 input-lebel col-md-offset-1">
											<h4>出租类型</h4>
										</div>
										<div class="col-md-5 input-lebel">
											<h4>房源类型</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 wxm-offleftwidth" id="wxm-fangyuan">
											<select id="renttype" class="form-control">
												<option value="1">整套房子</option>
												<option value="2">独立房间</option>
												<option value="3">合住房间</option>
												<option value="4">沙发客</option>
												<option value="5">地铺</option>
											</select>
										</div>
										<div class="col-md-5  wxm-offleftwidth" id="wxm-fangke">
											<select id="housetype" class="form-control">
												<option value="1">公寓</option>
												<option value="2">普通民宅</option>
												<option value="3">附属单元</option>
												<option value="4">特色房源</option>
												<option value="5">精品酒店</option>
											</select>
										</div>
									</div>
									<!--第三行输入框（各种数量）-->
									<div class="row">
										<div class="col-md-5 col-md-offset-1 input-lebel" style="text-align:left;">
											<h4>房客数量</h4>
										</div>
										<div class="col-md-5  input-lebel" style="text-align:left;">
											<h4>卧室数量</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 wxm-offleftwidth">
											<input class="form-control" id="unum"/>
										</div>
										<div class="col-md-5  wxm-offleftwidth">
											<input class="form-control" id="roomnum"/>
										</div>
									</div>	
									<!--第四行输入框（各种数量）-->
									<div class="row">
											<div class="col-md-5 col-md-offset-1 input-lebel" style="text-align:left;">
												<h4>床铺数量</h4>
											</div>
											<div class="col-md-5  input-lebel" style="text-align:left;">
												<h4>卫生间数量</h4>
											</div>
											<div class="col-md-5 col-md-offset-1  wxm-offleftwidth">
												<input class="form-control" id="bednum" />
											</div>
											<div class="col-md-5 wxm-offleftwidth">
												<input class="form-control" id="wcnum"/>
											</div>
									</div>
									<!--第五行输入框（详细地址）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4>您的房源详细地址</h4>
										</div>
										<div class="col-md-10 col-md-offset-1">
											<input class="form-control" id="adress"/>
										</div>
									</div>
									<!--第六行输入框（设施）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4 style="font-weight: bold;">便利设施</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="1" value="1">生活必需品
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="2" value="2">无线网
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="3" value="3">洗发水
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="4" value="4">抽屉/壁橱
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="5" value="5">电视
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="6" value="6">暖气
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="7" value="7">空调
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="8" value="8">早餐
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="9" value="9">书桌
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="12" value="12">吹风机
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="10" value="10">壁炉
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="11" value="11">熨斗
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="13" value="13">独立入口
										    </label>
										</div>
									</div>
									<!--第七行输入框（设施）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4 style="font-weight: bold;">安全设施</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="14" value="14">烟雾报警器
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="15" value="15">一氧化碳报警器
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="16" value="16">急救包
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="17" value="17">灭火器
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="18" value="18">带锁的卧室
										    </label>
										</div>
									</div>
									<!--第八行输入框（设施）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4 style="font-weight: bold;">房屋设施</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="19" value="19">游泳池
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="20" value="20">厨房
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="21" value="21">洗衣机
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="22" value="22">干衣机
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="23" value="23">停车位
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="24" value="24">电梯
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="25" value="25">按摩浴缸
										    </label>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c1" id="26" value="26">健身房
										    </label>
										</div>
									</div>
									<!--第九行输入框（wc）-->
									<div class="row">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4 style="font-weight: bold;">其他</h4>
										</div>
										<div class="col-md-5 col-md-offset-1 setleft">
										    <label>
										      <input type="checkbox" name="c2" id="iswcp">提供专用卫生间
										    </label>
										</div>
									</div>
                                    <!--第十行输入框（价格）-->
									<div class="row" style="margin-bottom:20px;">
										<div class="col-md-10 col-md-offset-1 input-lebel">
											<h4 style="font-weight: bold;">单价/每天(人民币)</h4>
										</div>
										<div class="col-md-10 col-md-offset-1">
											<input class="form-control" id="price"/>
										</div>
									</div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-sm btn-info" data-dismiss="modal">取 消</button>
                                    <button type="button" class="btn btn-sm btn-primary" data-dismiss="modal" id="btn-update" value="">提交</button>
                                </div>
                            </div>
                        </div>
                    </div><!--修改模态框div-->
				</div>

	
	<script type="text/javascript" src="js/jquery-3.3.1.min.js" ></script>
	<script type="text/javascript" src="js/bootstrap.min.js" ></script>
	<script type="text/javascript" src="js/clock.js"></script>
<script>
$(document).ready(function(){
		$("#fangyuanbiao").empty();
			$.ajax({
			url: "/airbnb/houseinfoInquire.do",
			async: false,
		   	type: "POST",
		   	error: function (){
		   		alert("数据提交失败")
		   	},
		   	success: function(json){
		   		var html = "<table id='housetab' class='table table-striped table-bordered ccc11'>";
			   	
			
			   	html+="<thead>";
			   	html+="<tr>";
			   	html+="<th style='display:none'>房源ID</th>";
			   	html+="<th>房名</th>";
			   	html+="<th>房源类型</th>";
			   	html+="<th>出租类型</th>";
				html+="<th>房间数</th>";
			   	html+="<th>床数</th>";
			   	html+="<th>卫生间数</th>";
			   	html+="<th>卫生间是否私有</th>";
			   	html+="<th>地区</th>";
			   	html+="<th>地址</th>";
			   	html+="<th>单价</th>";
			   	html+="<th>修改</th>";
			   	html+="<th>删除</th>";
		
			   	html+="</tr>";
				html+="</thead>";
				html+="<tbody id='housetabbody'>";
				html+="</tbody>";
				html+="</table>";
			  
			   	$("#fangyuanbiao").append(html);
		   		for(var i = 0;i<json.length;i++){
		   			var html2 = "<tr>";
	
		   			html2+="<td style='display:none'>";
		   			html2+=json[i].houseid;
		   			html2+="</td>";
		   			
		   			
		   			html2+="<td>";
		   			html2+=json[i].housename;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].htid;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].rtid;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].roomnum;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].bednum;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].wcnum;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].iswcp;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].area;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].adress;
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+=json[i].price;
		   			html2+="</td>";
		   		
		   			html2+="<td>";
		   			html2+="<button class='btn btn-success btn-sm' data-toggle='modal' data-target='#changehouse'>修改</button>"
		   			html2+="</td>";
		   			html2+="<td>";
		   			html2+="<button type='button' class='btn btn-danger btn-sm anniu22'>删除</button>"
		   			html2+="</td>";
		   			
		   			
		   			html2+="</tr>";
		   			$("#housetabbody").append(html2);
		   	
		   		}
		   		 
		  
		   	}
		});
			$(document).on("click",".anniu22",function (){

				var a=$(this).parent().parent().children();
				var houseid=$(a[0]).text();
				
				$.ajax({
					url: "/airbnb/houseinfodeletea.do",
					async: false,
				   	type: "POST",
				   	data : {"houseid":houseid},
				   	error: function (){
				   		alert("数据提交失败")
				   	},
				 	success: function(json){
				 		window.location.reload()
				 	},
				});
		 });	
});
</script>


	</body>
</html>
